﻿using System;
using System.IO;
using System.Threading;

namespace IceDog.SP.TimeWriterService
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(string.Join(",", args));
            var path = Path.Combine(AppContext.BaseDirectory, "time-service.txt");
            Console.WriteLine("Path:" + path);
            TextWriter tw = File.CreateText(path);
            while (true)
            {
                var time = DateTime.Now.ToLocalTime().ToString();
                var text = "当前时间是：" + time + "\r\n";
                Console.WriteLine(text);
                tw.WriteLine(text);
                tw.Flush();
                Thread.Sleep(1000);
            }
        }
    }
}
